package com.lovenote.common.pojo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * Attachement class
 * 
 * @author xingkong1221
 *
 */
@Entity
@Table(name = "common_attachment")
public class Attachment implements Serializable {
	
	private static final long serialVersionUID = -7234663798583613425L;

	@Id
	@Column(name = "id", length = 10)
	@GenericGenerator(name = "generator", strategy = "increment")
	@GeneratedValue(generator = "generator")
	private long id;
	
	@Column(name = "user_id", nullable = false, length = 10)
	private long userId;
	
	@Column(name = "dateline", nullable = true)
	private Date dateline;
	
	@Column(name = "filename", nullable = false, length = 255)
	private String filename;
	
	@Column(name = "filesize", nullable = false, length = 10)
	private int filesize;
	
	@Column(name = "is_image", nullable = false)
	private boolean isImage;
	
	@Column(name = "attachment", nullable = false, length = 255)
	private String attachment;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public long getUserId() {
		return userId;
	}

	public void setUserId(long userId) {
		this.userId = userId;
	}

	public Date getDateline() {
		return dateline;
	}

	public void setDateline(Date dateline) {
		this.dateline = dateline;
	}

	public String getFilename() {
		return filename;
	}

	public void setFilename(String filename) {
		this.filename = filename;
	}

	public int getFilesize() {
		return filesize;
	}

	public void setFilesize(int filesize) {
		this.filesize = filesize;
	}

	public boolean isImage() {
		return isImage;
	}

	public void setImage(boolean isImage) {
		this.isImage = isImage;
	}

	public String getAttachment() {
		return attachment;
	}

	public void setAttachment(String attachment) {
		this.attachment = attachment;
	}
	
}
